package com.banzhi.shop.utils;

import android.content.Context;

import com.banzhi.shop.view.CustomProgressDialog;


/**
 * loadingDialog
 */
public class LoadingDialogUtils {

    private static CustomProgressDialog loadingDialog;

    public static void showProgress(Context context, String msg) {

        if (loadingDialog == null) {
            loadingDialog = CustomProgressDialog.createDialog(context);
            loadingDialog.setMessage(msg);
            loadingDialog.show();
        }


    }
    public static void showProgress(Context context) {

        if (loadingDialog == null) {
            loadingDialog = CustomProgressDialog.createDialog(context);
            loadingDialog.setMessage("正在加载,请稍后~");
            loadingDialog.show();
        }


    }

    public static void dismiss() {
        if (loadingDialog != null && loadingDialog.isShowing()) {
            loadingDialog.dismiss();
            loadingDialog = null;
        }
    }
}
